package com.study.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class LogServiceProxy implements InvocationHandler {

    private Object object;

    public LogServiceProxy(Object object){
        this.object = object;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println(method.getName()+",开始执行");
        method.invoke(object,args);
        System.out.println(method.getName()+",执行成功");

        return null;
    }
}
